/* 
 * $Id$
 *
 * UMKC Robotics 2009
**/


#include "err.h"
extern int err;


#include "atmega128.h"
#include "iopublic.h"
extern BotIo bio;
extern BotIoctl bioctl;

#include "runtime.h"

static int rt_init();
static inline int rt_reset();


BotRuntime brt = {
  &rt_init,
  &rt_reset
};


static int rt_init() {

  bio.init();
  bioctl.load(Bstdout);
  bioctl.load(Bstdin);
  bioctl.load(Bstderr);

/* TODO: spoof avr devices. */ 
#if defined(WITH_AVRLIBC)
  mega128_init();
#endif

  return(E_NO_ERROR);

}

/* why? */
static inline int rt_reset() {
  return( rt_init() );
}



